macros-rs
macros-rs is a simple, lightweight, and useful library for miscellaneous macros.
Getting Started
To get started check out the docs on docs.rs!
// main.rs
use ;
)
)
macros-rs is a simple, lightweight, and useful library for miscellaneous macros.
To get started check out the docs on docs.rs!
// main.rs
use macros_rs::{exp::ternary, fmt::fmtstr};
fn main() {
let value = true;
let hello = "hello";
println!("{:?} world", ternary!(value, fmtstr!("{hello}"), ""));
}
$ cargo run
Compiling project (/crates)
Finished build [unoptimized + debuginfo] target(s)
"hello" world